Repository navigation
feat: project-scoped agent directory — multiple engineers across projects - #592
Conversation
Agent directory now defaults to project scope (<repo>/.genie/agents.json)
with fallback to global (~/.genie/agent-directory.json) then built-ins.
- add/rm/edit default to project scope, accept { global: true } option
- resolve() checks project → global → built-in roles → built-in council
- ls() returns entries from all scopes with scope label
- dir CLI commands accept --global flag
- dir ls shows SCOPE column
Closes #578
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant architectural change to the agent directory by implementing project-scoped agent management. This allows developers to define and manage agents relevant to a specific codebase, alongside existing global and built-in agents. The change provides greater flexibility and organization for agent configurations, ensuring that agent definitions can be tailored to individual project needs while still allowing for globally accessible agents. The resolution hierarchy ensures that project-specific configurations take precedence, offering a clear and predictable agent lookup mechanism. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83fdf8e898
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function getProjectDirectoryPath(): string { | ||
| return join(getProjectRoot(), '.genie', 'agents.json'); |
There was a problem hiding this comment.
Use shared repo .genie path for project-scoped directory
getProjectDirectoryPath() now hardcodes <git toplevel>/.genie/agents.json, but in git worktrees git rev-parse --show-toplevel points at the worktree root, not the main repo, so directory entries written in the main project become invisible when commands run inside a worktree. This breaks project-scoped resolution (resolve, ls, and auto-spawn checks that call resolve) for normal worktree-based flows, even though the codebase already has shared-worktree .genie handling via getRepoGenieDir() in src/lib/genie-dir.ts.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Code Review
This pull request introduces project-scoped agent directories, a significant enhancement that allows engineers to manage agents on a per-project basis. The changes are well-structured, with a clear separation between project-level (.genie/agents.json) and global (~/.genie/agent-directory.json) configurations. The resolution logic correctly prioritizes project-scoped agents over global ones, and global over built-in ones. The CLI commands (add, rm, edit, ls) have been updated with a --global flag to manage agents in different scopes, and the ls command now helpfully displays the scope of each agent. The test suite has been thoroughly updated to cover these new features, including shadowing and scope-specific operations. I have one minor suggestion to improve code clarity.
| export function getProjectRoot(): string { | ||
| if (process.env.GENIE_PROJECT_ROOT) return process.env.GENIE_PROJECT_ROOT; | ||
| try { | ||
| return execSync('git rev-parse --show-toplevel', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim(); |
There was a problem hiding this comment.
For clarity and to be more explicit about the intent, you can use 'ignore' for stdin and stderr in the stdio options. This makes it clearer that you are intentionally ignoring these streams rather than just piping them to be discarded.
| return execSync('git rev-parse --show-toplevel', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim(); | |
| return execSync('git rev-parse --show-toplevel', { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'] }).trim(); |
Summary
Closes #578. Agent directory is now project-scoped.
genie dir add engineer --dir /pathwrites to<repo>/.genie/agents.jsonby default. Resolution: project → global → built-in.Changes
add/rm/editdefault to project scope,--globalfor globalresolve(): project.genie/agents.json→ global~/.genie/agent-directory.json→ built-inlsshows SCOPE column (project/global/built-in)